using DevExpress.XtraEditors;
using DevExpress.XtraTab;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace NoteManger
{
	public class FrmNoteQuery : Form
	{
		private IContainer components = null;
		private ToolTip toolTip;
		private ContextMenuStrip contextMenuStrip;
		private ToolStripMenuItem pmSendMsg;
		private ImageList imageList;
		private SplitContainerControl splitContainerControl;
		public TreeView treeViewNote;
		private XtraTabControl xtraTabControlQuery;
		private XtraTabPage xtraTabPageResult;
		private ListView listViewNote;
		private XtraTabPage xtraTabPageDesign;
		private Button btndel;
		private System.Windows.Forms.ComboBox cbbqueryname;
		private Button btnAddQuery;
		private Button btnQuery;
		private Label label7;
		private System.Windows.Forms.ComboBox cbbNoteTypeName;
		private NumericUpDown nudHdxs;
		private System.Windows.Forms.ComboBox cbbHdxs;
		private Label label6;
		private Label label5;
		private System.Windows.Forms.ComboBox cbbNoteState;
		private NumericUpDown nudWorkLoad;
		private System.Windows.Forms.ComboBox cbbWorkLoad;
		private Label label3;
		private TextBox tboxNoteBody;
		private System.Windows.Forms.ComboBox cbbNoteBody;
		private Label label2;
		private TextBox tboxNoteTopic;
		private System.Windows.Forms.ComboBox cbbNoteTopic;
		private Label label1;
		private System.Windows.Forms.ComboBox cbbNoteTypeID;
		private System.Windows.Forms.ComboBox cbbNoteOwnerNames;
		private Label label4;
		private System.Windows.Forms.ComboBox cbbNoteOwnerIDs;
		private CheckBox cbkAuditDate;
		private DateTimePicker dtpAuditEndDate;
		private Label label10;
		private DateTimePicker dtpAuditBeginDate;
		private Label label11;
		private CheckBox cbkCreateDate;
		private DateTimePicker dtpCreateEndDate;
		private Label label9;
		private DateTimePicker dtpCreateBeginDate;
		private Label label8;
		private ListView tmpListView = new ListView();
		private string sCurrentQueryBody = "";
		private TLoginInfo _LoginInfo = new TLoginInfo();
		private NoteRemote _NoteRemoteObject = null;
		public TLoginInfo LoginInfo
		{
			set
			{
				this._LoginInfo = value;
			}
		}
		public NoteRemote NoteRemoteObject
		{
			set
			{
				this._NoteRemoteObject = value;
			}
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.components = new Container();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(FrmNoteQuery));
			this.contextMenuStrip = new ContextMenuStrip(this.components);
			this.pmSendMsg = new ToolStripMenuItem();
			this.imageList = new ImageList(this.components);
			this.toolTip = new ToolTip(this.components);
			this.splitContainerControl = new SplitContainerControl();
			this.treeViewNote = new TreeView();
			this.cbbNoteTypeID = new System.Windows.Forms.ComboBox();
			this.cbbNoteOwnerIDs = new System.Windows.Forms.ComboBox();
			this.xtraTabControlQuery = new XtraTabControl();
			this.xtraTabPageResult = new XtraTabPage();
			this.listViewNote = new ListView();
			this.xtraTabPageDesign = new XtraTabPage();
			this.cbkAuditDate = new CheckBox();
			this.dtpAuditEndDate = new DateTimePicker();
			this.label10 = new Label();
			this.dtpAuditBeginDate = new DateTimePicker();
			this.label11 = new Label();
			this.cbkCreateDate = new CheckBox();
			this.dtpCreateEndDate = new DateTimePicker();
			this.label9 = new Label();
			this.dtpCreateBeginDate = new DateTimePicker();
			this.label8 = new Label();
			this.cbbNoteOwnerNames = new System.Windows.Forms.ComboBox();
			this.label4 = new Label();
			this.cbbNoteTypeName = new System.Windows.Forms.ComboBox();
			this.btndel = new Button();
			this.cbbqueryname = new System.Windows.Forms.ComboBox();
			this.btnAddQuery = new Button();
			this.btnQuery = new Button();
			this.label7 = new Label();
			this.nudHdxs = new NumericUpDown();
			this.cbbHdxs = new System.Windows.Forms.ComboBox();
			this.label6 = new Label();
			this.label5 = new Label();
			this.cbbNoteState = new System.Windows.Forms.ComboBox();
			this.nudWorkLoad = new NumericUpDown();
			this.cbbWorkLoad = new System.Windows.Forms.ComboBox();
			this.label3 = new Label();
			this.tboxNoteBody = new TextBox();
			this.cbbNoteBody = new System.Windows.Forms.ComboBox();
			this.label2 = new Label();
			this.tboxNoteTopic = new TextBox();
			this.cbbNoteTopic = new System.Windows.Forms.ComboBox();
			this.label1 = new Label();
			this.contextMenuStrip.SuspendLayout();
			((ISupportInitialize)this.splitContainerControl).BeginInit();
			this.splitContainerControl.SuspendLayout();
			((ISupportInitialize)this.xtraTabControlQuery).BeginInit();
			this.xtraTabControlQuery.SuspendLayout();
			this.xtraTabPageResult.SuspendLayout();
			this.xtraTabPageDesign.SuspendLayout();
			((ISupportInitialize)this.nudHdxs).BeginInit();
			((ISupportInitialize)this.nudWorkLoad).BeginInit();
			base.SuspendLayout();
			this.contextMenuStrip.Items.AddRange(new ToolStripItem[]
			{
				this.pmSendMsg
			});
			this.contextMenuStrip.Name = "contextMenuStrip";
			this.contextMenuStrip.Size = new System.Drawing.Size(195, 26);
			this.pmSendMsg.Enabled = false;
			this.pmSendMsg.Name = "pmSendMsg";
			this.pmSendMsg.Size = new System.Drawing.Size(194, 22);
			this.pmSendMsg.Text = "发送异常审核反馈信息";
			this.pmSendMsg.Click += new EventHandler(this.pmSendMsg_Click);
			this.imageList.ImageStream = (ImageListStreamer)componentResourceManager.GetObject("imageList.ImageStream");
			this.imageList.TransparentColor = System.Drawing.Color.Transparent;
			this.imageList.Images.SetKeyName(0, "summary.ico");
			this.imageList.Images.SetKeyName(1, "Card.ico");
			this.imageList.Images.SetKeyName(2, "Card-Add.ico");
			this.imageList.Images.SetKeyName(3, "Card-Delete.ico");
			this.imageList.Images.SetKeyName(4, "Mail-Forward.ico");
			this.imageList.Images.SetKeyName(5, "Connect.ico");
			this.imageList.Images.SetKeyName(6, "Certificate.ico");
			this.imageList.Images.SetKeyName(7, "Loginout.ico");
			this.imageList.Images.SetKeyName(8, "key.ico");
			this.imageList.Images.SetKeyName(9, "User-Add.ico");
			this.imageList.Images.SetKeyName(10, "configure.ico");
			this.imageList.Images.SetKeyName(11, "refresh.ico");
			this.imageList.Images.SetKeyName(12, "Card-New.ico");
			this.imageList.Images.SetKeyName(13, "Card-Edit.ico");
			this.imageList.Images.SetKeyName(14, "convert.ico");
			this.imageList.Images.SetKeyName(15, "search.ico");
			this.imageList.Images.SetKeyName(16, "Export.ico");
			this.imageList.Images.SetKeyName(17, "Flow Chart.ico");
			this.imageList.Images.SetKeyName(18, "User-Edit.ico");
			this.imageList.Images.SetKeyName(19, "User-Security-2.ico");
			this.toolTip.AutoPopDelay = 10000;
			this.toolTip.InitialDelay = 500;
			this.toolTip.IsBalloon = true;
			this.toolTip.ReshowDelay = 100;
			this.toolTip.ToolTipIcon = ToolTipIcon.Info;
			this.splitContainerControl.Dock = DockStyle.Fill;
			this.splitContainerControl.Location = new System.Drawing.Point(0, 0);
			this.splitContainerControl.Name = "splitContainerControl";
			this.splitContainerControl.Panel1.Controls.Add(this.treeViewNote);
			this.splitContainerControl.Panel1.Controls.Add(this.cbbNoteTypeID);
			this.splitContainerControl.Panel1.Controls.Add(this.cbbNoteOwnerIDs);
			this.splitContainerControl.Panel1.Text = "Panel1";
			this.splitContainerControl.Panel2.Controls.Add(this.xtraTabControlQuery);
			this.splitContainerControl.Panel2.Text = "Panel2";
			this.splitContainerControl.Size = new System.Drawing.Size(705, 410);
			this.splitContainerControl.SplitterPosition = 221;
			this.splitContainerControl.TabIndex = 45;
			this.splitContainerControl.Text = "splitContainerControl1";
			this.treeViewNote.AllowDrop = true;
			this.treeViewNote.BackColor = System.Drawing.Color.White;
			this.treeViewNote.Cursor = Cursors.Hand;
			this.treeViewNote.Dock = DockStyle.Fill;
			this.treeViewNote.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.treeViewNote.ForeColor = System.Drawing.SystemColors.InfoText;
			this.treeViewNote.ImageIndex = 0;
			this.treeViewNote.ImageList = this.imageList;
			this.treeViewNote.Location = new System.Drawing.Point(0, 0);
			this.treeViewNote.Name = "treeViewNote";
			this.treeViewNote.SelectedImageIndex = 0;
			this.treeViewNote.Size = new System.Drawing.Size(217, 406);
			this.treeViewNote.TabIndex = 45;
			this.treeViewNote.NodeMouseClick += new TreeNodeMouseClickEventHandler(this.treeViewNote_NodeMouseClick);
			this.cbbNoteTypeID.FormattingEnabled = true;
			this.cbbNoteTypeID.Location = new System.Drawing.Point(54, 193);
			this.cbbNoteTypeID.Name = "cbbNoteTypeID";
			this.cbbNoteTypeID.Size = new System.Drawing.Size(85, 20);
			this.cbbNoteTypeID.TabIndex = 47;
			this.cbbNoteTypeID.Visible = false;
			this.cbbNoteOwnerIDs.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.cbbNoteOwnerIDs.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbNoteOwnerIDs.FormattingEnabled = true;
			this.cbbNoteOwnerIDs.Location = new System.Drawing.Point(54, 150);
			this.cbbNoteOwnerIDs.Name = "cbbNoteOwnerIDs";
			this.cbbNoteOwnerIDs.Size = new System.Drawing.Size(94, 20);
			this.cbbNoteOwnerIDs.TabIndex = 53;
			this.xtraTabControlQuery.Dock = DockStyle.Fill;
			this.xtraTabControlQuery.Location = new System.Drawing.Point(0, 0);
			this.xtraTabControlQuery.Name = "xtraTabControlQuery";
			this.xtraTabControlQuery.SelectedTabPage = this.xtraTabPageResult;
			this.xtraTabControlQuery.Size = new System.Drawing.Size(474, 406);
			this.xtraTabControlQuery.TabIndex = 0;
			this.xtraTabControlQuery.TabPages.AddRange(new XtraTabPage[]
			{
				this.xtraTabPageResult,
				this.xtraTabPageDesign
			});
			this.xtraTabControlQuery.SelectedPageChanged += new TabPageChangedEventHandler(this.xtraTabControlQuery_SelectedPageChanged);
			this.xtraTabPageResult.Controls.Add(this.listViewNote);
			this.xtraTabPageResult.Name = "xtraTabPageResult";
			this.xtraTabPageResult.Size = new System.Drawing.Size(465, 374);
			this.xtraTabPageResult.Text = "查询结果";
			this.listViewNote.ContextMenuStrip = this.contextMenuStrip;
			this.listViewNote.Dock = DockStyle.Fill;
			this.listViewNote.FullRowSelect = true;
			this.listViewNote.Location = new System.Drawing.Point(0, 0);
			this.listViewNote.MultiSelect = false;
			this.listViewNote.Name = "listViewNote";
			this.listViewNote.Size = new System.Drawing.Size(465, 374);
			this.listViewNote.SmallImageList = this.imageList;
			this.listViewNote.TabIndex = 10;
			this.listViewNote.TabStop = false;
			this.listViewNote.UseCompatibleStateImageBehavior = false;
			this.listViewNote.View = View.Details;
			this.listViewNote.SelectedIndexChanged += new EventHandler(this.listViewNote_SelectedIndexChanged);
			this.listViewNote.DoubleClick += new EventHandler(this.listViewNote_DoubleClick);
			this.listViewNote.MouseMove += new MouseEventHandler(this.listViewNote_MouseMove);
			this.xtraTabPageDesign.Controls.Add(this.cbkAuditDate);
			this.xtraTabPageDesign.Controls.Add(this.dtpAuditEndDate);
			this.xtraTabPageDesign.Controls.Add(this.label10);
			this.xtraTabPageDesign.Controls.Add(this.dtpAuditBeginDate);
			this.xtraTabPageDesign.Controls.Add(this.label11);
			this.xtraTabPageDesign.Controls.Add(this.cbkCreateDate);
			this.xtraTabPageDesign.Controls.Add(this.dtpCreateEndDate);
			this.xtraTabPageDesign.Controls.Add(this.label9);
			this.xtraTabPageDesign.Controls.Add(this.dtpCreateBeginDate);
			this.xtraTabPageDesign.Controls.Add(this.label8);
			this.xtraTabPageDesign.Controls.Add(this.cbbNoteOwnerNames);
			this.xtraTabPageDesign.Controls.Add(this.label4);
			this.xtraTabPageDesign.Controls.Add(this.cbbNoteTypeName);
			this.xtraTabPageDesign.Controls.Add(this.btndel);
			this.xtraTabPageDesign.Controls.Add(this.cbbqueryname);
			this.xtraTabPageDesign.Controls.Add(this.btnAddQuery);
			this.xtraTabPageDesign.Controls.Add(this.btnQuery);
			this.xtraTabPageDesign.Controls.Add(this.label7);
			this.xtraTabPageDesign.Controls.Add(this.nudHdxs);
			this.xtraTabPageDesign.Controls.Add(this.cbbHdxs);
			this.xtraTabPageDesign.Controls.Add(this.label6);
			this.xtraTabPageDesign.Controls.Add(this.label5);
			this.xtraTabPageDesign.Controls.Add(this.cbbNoteState);
			this.xtraTabPageDesign.Controls.Add(this.nudWorkLoad);
			this.xtraTabPageDesign.Controls.Add(this.cbbWorkLoad);
			this.xtraTabPageDesign.Controls.Add(this.label3);
			this.xtraTabPageDesign.Controls.Add(this.tboxNoteBody);
			this.xtraTabPageDesign.Controls.Add(this.cbbNoteBody);
			this.xtraTabPageDesign.Controls.Add(this.label2);
			this.xtraTabPageDesign.Controls.Add(this.tboxNoteTopic);
			this.xtraTabPageDesign.Controls.Add(this.cbbNoteTopic);
			this.xtraTabPageDesign.Controls.Add(this.label1);
			this.xtraTabPageDesign.Name = "xtraTabPageDesign";
			this.xtraTabPageDesign.Size = new System.Drawing.Size(465, 374);
			this.xtraTabPageDesign.Text = "查询设计器";
			this.cbkAuditDate.AutoSize = true;
			this.cbkAuditDate.Checked = true;
			this.cbkAuditDate.CheckState = CheckState.Checked;
			this.cbkAuditDate.Location = new System.Drawing.Point(386, 308);
			this.cbkAuditDate.Name = "cbkAuditDate";
			this.cbkAuditDate.Size = new System.Drawing.Size(72, 16);
			this.cbkAuditDate.TabIndex = 62;
			this.cbkAuditDate.Text = "忽略日期";
			this.cbkAuditDate.UseVisualStyleBackColor = true;
			this.cbkAuditDate.CheckedChanged += new EventHandler(this.cbkAuditDate_CheckedChanged);
			this.dtpAuditEndDate.Enabled = false;
			this.dtpAuditEndDate.Location = new System.Drawing.Point(238, 305);
			this.dtpAuditEndDate.Name = "dtpAuditEndDate";
			this.dtpAuditEndDate.Size = new System.Drawing.Size(132, 21);
			this.dtpAuditEndDate.TabIndex = 61;
			this.label10.AutoSize = true;
			this.label10.ForeColor = System.Drawing.Color.Black;
			this.label10.Location = new System.Drawing.Point(215, 309);
			this.label10.Name = "label10";
			this.label10.Size = new System.Drawing.Size(17, 12);
			this.label10.TabIndex = 60;
			this.label10.Text = "到";
			this.label10.TextAlign = System.Drawing.ContentAlignment.TopRight;
			this.dtpAuditBeginDate.Enabled = false;
			this.dtpAuditBeginDate.Location = new System.Drawing.Point(77, 305);
			this.dtpAuditBeginDate.Name = "dtpAuditBeginDate";
			this.dtpAuditBeginDate.Size = new System.Drawing.Size(132, 21);
			this.dtpAuditBeginDate.TabIndex = 59;
			this.label11.AutoSize = true;
			this.label11.ForeColor = System.Drawing.Color.Black;
			this.label11.Location = new System.Drawing.Point(9, 311);
			this.label11.Name = "label11";
			this.label11.Size = new System.Drawing.Size(65, 12);
			this.label11.TabIndex = 58;
			this.label11.Text = "审核日期从";
			this.label11.TextAlign = System.Drawing.ContentAlignment.TopRight;
			this.cbkCreateDate.AutoSize = true;
			this.cbkCreateDate.Checked = true;
			this.cbkCreateDate.CheckState = CheckState.Checked;
			this.cbkCreateDate.Location = new System.Drawing.Point(386, 271);
			this.cbkCreateDate.Name = "cbkCreateDate";
			this.cbkCreateDate.Size = new System.Drawing.Size(72, 16);
			this.cbkCreateDate.TabIndex = 57;
			this.cbkCreateDate.Text = "忽略日期";
			this.cbkCreateDate.UseVisualStyleBackColor = true;
			this.cbkCreateDate.CheckedChanged += new EventHandler(this.cbkCreateDate_CheckedChanged);
			this.dtpCreateEndDate.Enabled = false;
			this.dtpCreateEndDate.Location = new System.Drawing.Point(238, 268);
			this.dtpCreateEndDate.Name = "dtpCreateEndDate";
			this.dtpCreateEndDate.Size = new System.Drawing.Size(132, 21);
			this.dtpCreateEndDate.TabIndex = 56;
			this.label9.AutoSize = true;
			this.label9.ForeColor = System.Drawing.Color.Black;
			this.label9.Location = new System.Drawing.Point(215, 272);
			this.label9.Name = "label9";
			this.label9.Size = new System.Drawing.Size(17, 12);
			this.label9.TabIndex = 55;
			this.label9.Text = "到";
			this.label9.TextAlign = System.Drawing.ContentAlignment.TopRight;
			this.dtpCreateBeginDate.Enabled = false;
			this.dtpCreateBeginDate.Location = new System.Drawing.Point(77, 268);
			this.dtpCreateBeginDate.Name = "dtpCreateBeginDate";
			this.dtpCreateBeginDate.Size = new System.Drawing.Size(132, 21);
			this.dtpCreateBeginDate.TabIndex = 54;
			this.label8.AutoSize = true;
			this.label8.ForeColor = System.Drawing.Color.Black;
			this.label8.Location = new System.Drawing.Point(9, 272);
			this.label8.Name = "label8";
			this.label8.Size = new System.Drawing.Size(65, 12);
			this.label8.TabIndex = 53;
			this.label8.Text = "创建日期从";
			this.label8.TextAlign = System.Drawing.ContentAlignment.TopRight;
			this.cbbNoteOwnerNames.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.cbbNoteOwnerNames.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbNoteOwnerNames.FormattingEnabled = true;
			this.cbbNoteOwnerNames.Location = new System.Drawing.Point(65, 231);
			this.cbbNoteOwnerNames.MaxDropDownItems = 100;
			this.cbbNoteOwnerNames.Name = "cbbNoteOwnerNames";
			this.cbbNoteOwnerNames.Size = new System.Drawing.Size(396, 20);
			this.cbbNoteOwnerNames.TabIndex = 52;
			this.label4.AutoSize = true;
			this.label4.ForeColor = System.Drawing.Color.Black;
			this.label4.Location = new System.Drawing.Point(9, 234);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(59, 12);
			this.label4.TabIndex = 51;
			this.label4.Text = "所有者 = ";
			this.label4.TextAlign = System.Drawing.ContentAlignment.TopRight;
			this.cbbNoteTypeName.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.cbbNoteTypeName.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbNoteTypeName.FormattingEnabled = true;
			this.cbbNoteTypeName.Location = new System.Drawing.Point(65, 196);
			this.cbbNoteTypeName.Name = "cbbNoteTypeName";
			this.cbbNoteTypeName.Size = new System.Drawing.Size(396, 20);
			this.cbbNoteTypeName.TabIndex = 44;
			this.cbbNoteTypeName.DropDown += new EventHandler(this.cbbNoteTypeName_DropDown);
			this.btndel.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
			this.btndel.Location = new System.Drawing.Point(439, 346);
			this.btndel.Name = "btndel";
			this.btndel.Size = new System.Drawing.Size(24, 23);
			this.btndel.TabIndex = 50;
			this.btndel.Text = "X";
			this.btndel.UseVisualStyleBackColor = true;
			this.btndel.Click += new EventHandler(this.btndel_Click);
			this.cbbqueryname.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.cbbqueryname.Cursor = Cursors.Hand;
			this.cbbqueryname.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbqueryname.FormattingEnabled = true;
			this.cbbqueryname.Location = new System.Drawing.Point(251, 348);
			this.cbbqueryname.Name = "cbbqueryname";
			this.cbbqueryname.Size = new System.Drawing.Size(184, 20);
			this.cbbqueryname.TabIndex = 49;
			this.cbbqueryname.SelectedIndexChanged += new EventHandler(this.cbbqueryname_SelectedIndexChanged);
			this.btnAddQuery.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnAddQuery.Location = new System.Drawing.Point(121, 347);
			this.btnAddQuery.Name = "btnAddQuery";
			this.btnAddQuery.Size = new System.Drawing.Size(122, 23);
			this.btnAddQuery.TabIndex = 48;
			this.btnAddQuery.Text = "添加到查询收藏夹";
			this.btnAddQuery.UseVisualStyleBackColor = true;
			this.btnAddQuery.Click += new EventHandler(this.btnAddQuery_Click);
			this.btnQuery.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnQuery.Cursor = Cursors.Hand;
			this.btnQuery.Location = new System.Drawing.Point(10, 347);
			this.btnQuery.Name = "btnQuery";
			this.btnQuery.Size = new System.Drawing.Size(94, 23);
			this.btnQuery.TabIndex = 47;
			this.btnQuery.Text = "执行(&Q)";
			this.btnQuery.UseVisualStyleBackColor = true;
			this.btnQuery.Click += new EventHandler(this.btnQuery_Click);
			this.label7.AutoSize = true;
			this.label7.ForeColor = System.Drawing.Color.Black;
			this.label7.Location = new System.Drawing.Point(9, 199);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(59, 12);
			this.label7.TabIndex = 45;
			this.label7.Text = "分  类 = ";
			this.nudHdxs.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.nudHdxs.DecimalPlaces = 1;
			this.nudHdxs.Increment = new decimal(new int[]
			{
				1,
				0,
				0,
				65536
			});
			this.nudHdxs.Location = new System.Drawing.Point(136, 161);
			NumericUpDown arg_1778_0 = this.nudHdxs;
			int[] array = new int[4];
			array[0] = 24;
			arg_1778_0.Maximum = new decimal(array);
			this.nudHdxs.Name = "nudHdxs";
			this.nudHdxs.Size = new System.Drawing.Size(326, 21);
			this.nudHdxs.TabIndex = 27;
			this.cbbHdxs.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbHdxs.FormattingEnabled = true;
			this.cbbHdxs.Items.AddRange(new object[]
			{
				">=",
				"<=",
				"=",
				">",
				"<"
			});
			this.cbbHdxs.Location = new System.Drawing.Point(65, 162);
			this.cbbHdxs.Name = "cbbHdxs";
			this.cbbHdxs.Size = new System.Drawing.Size(66, 20);
			this.cbbHdxs.TabIndex = 26;
			this.label6.AutoSize = true;
			this.label6.Location = new System.Drawing.Point(9, 167);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(53, 12);
			this.label6.TabIndex = 25;
			this.label6.Text = "核定系数";
			this.label5.AutoSize = true;
			this.label5.Location = new System.Drawing.Point(9, 130);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(53, 12);
			this.label5.TabIndex = 24;
			this.label5.Text = "审核状态";
			this.cbbNoteState.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.cbbNoteState.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbNoteState.FormattingEnabled = true;
			this.cbbNoteState.Items.AddRange(new object[]
			{
				"全部",
				"未审核",
				"已审核",
				"被置疑"
			});
			this.cbbNoteState.Location = new System.Drawing.Point(65, 127);
			this.cbbNoteState.Name = "cbbNoteState";
			this.cbbNoteState.Size = new System.Drawing.Size(396, 20);
			this.cbbNoteState.TabIndex = 23;
			this.nudWorkLoad.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.nudWorkLoad.DecimalPlaces = 1;
			this.nudWorkLoad.Increment = new decimal(new int[]
			{
				1,
				0,
				0,
				65536
			});
			this.nudWorkLoad.Location = new System.Drawing.Point(135, 90);
			NumericUpDown arg_1A5A_0 = this.nudWorkLoad;
			array = new int[4];
			array[0] = 24;
			arg_1A5A_0.Maximum = new decimal(array);
			this.nudWorkLoad.Name = "nudWorkLoad";
			this.nudWorkLoad.Size = new System.Drawing.Size(326, 21);
			this.nudWorkLoad.TabIndex = 22;
			this.cbbWorkLoad.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbWorkLoad.FormattingEnabled = true;
			this.cbbWorkLoad.Items.AddRange(new object[]
			{
				">=",
				"<=",
				"=",
				">",
				"<"
			});
			this.cbbWorkLoad.Location = new System.Drawing.Point(65, 91);
			this.cbbWorkLoad.Name = "cbbWorkLoad";
			this.cbbWorkLoad.Size = new System.Drawing.Size(65, 20);
			this.cbbWorkLoad.TabIndex = 21;
			this.label3.AutoSize = true;
			this.label3.Location = new System.Drawing.Point(9, 94);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(53, 12);
			this.label3.TabIndex = 20;
			this.label3.Text = "工 作 量";
			this.tboxNoteBody.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.tboxNoteBody.Location = new System.Drawing.Point(135, 56);
			this.tboxNoteBody.Name = "tboxNoteBody";
			this.tboxNoteBody.Size = new System.Drawing.Size(326, 21);
			this.tboxNoteBody.TabIndex = 19;
			this.cbbNoteBody.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbNoteBody.FormattingEnabled = true;
			this.cbbNoteBody.Items.AddRange(new object[]
			{
				"包含",
				"不包含"
			});
			this.cbbNoteBody.Location = new System.Drawing.Point(65, 56);
			this.cbbNoteBody.Name = "cbbNoteBody";
			this.cbbNoteBody.Size = new System.Drawing.Size(65, 20);
			this.cbbNoteBody.TabIndex = 18;
			this.label2.AutoSize = true;
			this.label2.Location = new System.Drawing.Point(9, 59);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(53, 12);
			this.label2.TabIndex = 17;
			this.label2.Text = "正    文";
			this.tboxNoteTopic.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.tboxNoteTopic.Location = new System.Drawing.Point(135, 19);
			this.tboxNoteTopic.Name = "tboxNoteTopic";
			this.tboxNoteTopic.Size = new System.Drawing.Size(326, 21);
			this.tboxNoteTopic.TabIndex = 16;
			this.cbbNoteTopic.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbNoteTopic.FormattingEnabled = true;
			this.cbbNoteTopic.Items.AddRange(new object[]
			{
				"包含",
				"不包含"
			});
			this.cbbNoteTopic.Location = new System.Drawing.Point(65, 20);
			this.cbbNoteTopic.Name = "cbbNoteTopic";
			this.cbbNoteTopic.Size = new System.Drawing.Size(65, 20);
			this.cbbNoteTopic.TabIndex = 15;
			this.label1.AutoSize = true;
			this.label1.Location = new System.Drawing.Point(9, 24);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(53, 12);
			this.label1.TabIndex = 14;
			this.label1.Text = "主    题";
			base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
			base.AutoScaleMode = AutoScaleMode.Font;
			base.ClientSize = new System.Drawing.Size(705, 410);
			base.Controls.Add(this.splitContainerControl);
			base.Name = "FrmNoteQuery";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "日志查询";
			base.WindowState = FormWindowState.Maximized;
			base.Load += new EventHandler(this.FrmNoteQuery_Load);
			base.Shown += new EventHandler(this.FrmNoteQuery_Shown);
			this.contextMenuStrip.ResumeLayout(false);
			((ISupportInitialize)this.splitContainerControl).EndInit();
			this.splitContainerControl.ResumeLayout(false);
			((ISupportInitialize)this.xtraTabControlQuery).EndInit();
			this.xtraTabControlQuery.ResumeLayout(false);
			this.xtraTabPageResult.ResumeLayout(false);
			this.xtraTabPageDesign.ResumeLayout(false);
			this.xtraTabPageDesign.PerformLayout();
			((ISupportInitialize)this.nudHdxs).EndInit();
			((ISupportInitialize)this.nudWorkLoad).EndInit();
			base.ResumeLayout(false);
		}
		public FrmNoteQuery()
		{
			this.InitializeComponent();
			this.CreateColumn();
		}
		private void CreateColumn()
		{
			ColumnHeader columnHeader = new ColumnHeader();
			columnHeader.Text = "编号";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "所有者";
			columnHeader.Width = 100;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "日期";
			columnHeader.Width = 100;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "主题";
			columnHeader.Width = 300;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "工作量";
			columnHeader.Width = 60;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "正文";
			columnHeader.Width = 0;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "状态";
			columnHeader.Width = 60;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "创建日期";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "创建时间";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "置疑说明";
			columnHeader.Width = 150;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "审核人";
			columnHeader.Width = 90;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "审核日期";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "审核时间";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "核定系数";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "开始时间";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "结束时间";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "有效标志";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.listViewNote.Columns.Add(columnHeader);
		}
		private void FrmNoteQuery_Load(object sender, EventArgs e)
		{
			this.cbbNoteTopic.SelectedIndex = 0;
			this.cbbNoteBody.SelectedIndex = 0;
			this.cbbWorkLoad.SelectedIndex = 0;
			this.nudWorkLoad.Value = 0m;
			this.cbbNoteState.SelectedIndex = 0;
			this.cbbHdxs.SelectedIndex = 0;
			this.nudHdxs.Value = 0m;
		}
		private void listViewNote_MouseMove(object sender, MouseEventArgs e)
		{
		}
		private void btnQuery_Click(object sender, EventArgs e)
		{
			this.Text = "日志查询";
			try
			{
				if (!this._NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				return;
			}
			bool flag = false;
			bool flag2 = false;
			string text;
			if (this.cbbNoteOwnerNames.SelectedIndex <= 0)
			{
				text = "select a.NoteID,b.EmpName + '(' + convert(varchar,b.EmpID) + ')',a.NoteDate,a.NoteTopic,a.WorkLoad,a.NoteBody,(case a.NoteState when 1 then '已审核' when 2 then '被置疑' else '未审核' end) NoteSate,a.CreateDate,a.CreateTime,a.NoteMemo,a.Auditor,a.AuditDate,a.AuditTime,a.AuditWorkLoad,a.BeginTime,a.EndTime,(case a.RecordState when 0 then '有效' else '无效' end) RecordState from WorkNotes a,Employees b where a.EmpID = b.EmpID and a.EmpID not in('0') and";
			}
			else
			{
				text = "select a.NoteID,b.EmpName + '(' + convert(varchar,b.EmpID) + ')',a.NoteDate,a.NoteTopic,a.WorkLoad,a.NoteBody,(case a.NoteState when 1 then '已审核' when 2 then '被置疑' else '未审核' end) NoteSate,a.CreateDate,a.CreateTime,a.NoteMemo,a.Auditor,a.AuditDate,a.AuditTime,a.AuditWorkLoad,a.BeginTime,a.EndTime,(case a.RecordState when 0 then '有效' else '无效' end) RecordState from WorkNotes a,Employees b where a.EmpID = b.EmpID and a.EmpID='" + this.cbbNoteOwnerIDs.Items[this.cbbNoteOwnerNames.SelectedIndex].ToString() + "' and";
			}
			if (this.tboxNoteTopic.Text.Trim() != "")
			{
				if (this.cbbNoteTopic.SelectedIndex == 0)
				{
					text = text + " a.NoteTopic like '%" + this.tboxNoteTopic.Text.Trim() + "%'";
				}
				else
				{
					text = text + " a.NoteTopic not like '%" + this.tboxNoteTopic.Text.Trim() + "%'";
				}
				flag = true;
			}
			if (flag)
			{
				text += " and";
			}
			if (this.tboxNoteBody.Text.Trim() != "")
			{
				if (this.cbbNoteBody.SelectedIndex == 0)
				{
					text = text + " a.NoteBody like '%" + this.tboxNoteBody.Text.Trim() + "%'";
				}
				else
				{
					text = text + " a.NoteBody not like '%" + this.tboxNoteBody.Text.Trim() + "%'";
				}
				flag2 = true;
			}
			if (flag2)
			{
				text += " and";
			}
			text = string.Concat(new string[]
			{
				text,
				" WorkLoad ",
				this.cbbWorkLoad.Text.ToString(),
				" ",
				this.nudWorkLoad.Value.ToString()
			});
			if (this.cbbNoteState.SelectedIndex >= 1)
			{
				text = text + " and a.NoteState = " + (this.cbbNoteState.SelectedIndex - 1).ToString();
			}
			text = string.Concat(new string[]
			{
				text,
				" and a.AuditWorkLoad ",
				this.cbbHdxs.Text.ToString(),
				" ",
				this.nudHdxs.Value.ToString()
			});
			if (this.cbbNoteTypeName.SelectedIndex != -1)
			{
				if (this.cbbNoteTypeName.Text == "未分类")
				{
					text += " and isnull(a.TaskID,0) = 0";
				}
				else
				{
					text = text + " and isnull(a.TaskID,0) = " + this.cbbNoteTypeID.Items[this.cbbNoteTypeName.SelectedIndex].ToString();
				}
			}
			if (!this.cbkCreateDate.Checked)
			{
				text = string.Concat(new string[]
				{
					text,
					" and CreateDate between '",
					this.dtpCreateBeginDate.Value.ToString("yyyy-MM-dd"),
					"' and '",
					this.dtpCreateEndDate.Value.ToString("yyyy-MM-dd"),
					"'"
				});
			}
			if (!this.cbkAuditDate.Checked)
			{
				text = string.Concat(new string[]
				{
					text,
					" and AuditDate between '",
					this.dtpAuditBeginDate.Value.ToString("yyyy-MM-dd"),
					"' and '",
					this.dtpAuditEndDate.Value.ToString("yyyy-MM-dd"),
					"'"
				});
			}
			string[,] array = new string[0, 0];
			string text2 = "";
			this.btnQuery.Cursor = Cursors.WaitCursor;
			this.btnQuery.Refresh();
			this.btnQuery.Enabled = false;
			bool flag3 = this._NoteRemoteObject.CommonQuery(text, ref array, ref text2);
			if (flag3)
			{
				this.sCurrentQueryBody = text;
				int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
				this.listViewNote.BeginUpdate();
				this.listViewNote.Items.Clear();
				for (int i = 0; i < num; i++)
				{
					ListViewItem listViewItem = new ListViewItem();
					listViewItem.Text = array[i, 0];
					listViewItem.SubItems.Add(array[i, 1]);
					listViewItem.SubItems.Add(array[i, 2]);
					listViewItem.SubItems.Add(array[i, 3]);
					listViewItem.SubItems.Add(array[i, 4]);
					listViewItem.SubItems.Add(array[i, 5]);
					if (array[i, 6] == "未审核")
					{
						listViewItem.SubItems.Add("未审核");
						listViewItem.ImageIndex = 1;
					}
					if (array[i, 6] == "已审核")
					{
						listViewItem.SubItems.Add("已审核");
						listViewItem.ForeColor = System.Drawing.Color.Blue;
						listViewItem.ImageIndex = 2;
					}
					if (array[i, 6] == "被置疑")
					{
						listViewItem.SubItems.Add("被置疑");
						listViewItem.ForeColor = System.Drawing.Color.Red;
						listViewItem.ImageIndex = 3;
					}
					listViewItem.SubItems.Add(array[i, 7]);
					listViewItem.SubItems.Add(array[i, 8]);
					listViewItem.SubItems.Add(array[i, 9]);
					listViewItem.SubItems.Add(array[i, 10]);
					listViewItem.SubItems.Add(array[i, 11]);
					listViewItem.SubItems.Add(array[i, 12]);
					listViewItem.SubItems.Add(array[i, 13]);
					listViewItem.SubItems.Add(array[i, 14]);
					listViewItem.SubItems.Add(array[i, 15]);
					listViewItem.SubItems.Add(array[i, 16]);
					this.listViewNote.Items.Add(listViewItem);
				}
				this.listViewNote.EndUpdate();
				this.listViewNote.Refresh();
				this.xtraTabControlQuery.SelectedTabPage = this.xtraTabPageResult;
				MessageBox.Show("查询成功！返回记录 " + num.ToString() + " 条！现在可以转到“查询设计页面”，保存查询到“查询收藏夹”！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.xtraTabControlQuery.SelectedTabPage = this.xtraTabPageDesign;
			}
			else
			{
				MessageBox.Show(text2, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			this.btnQuery.Cursor = Cursors.Hand;
			this.btnQuery.Refresh();
			this.btnQuery.Enabled = true;
		}
		private void btnClose_Click(object sender, EventArgs e)
		{
		}
		private void listViewNote_ItemMouseHover(object sender, ListViewItemMouseHoverEventArgs e)
		{
			if (e.Item != null)
			{
			}
		}
		private void listViewNote_SelectedIndexChanged(object sender, EventArgs e)
		{
			this.pmSendMsg.Enabled = (this.listViewNote.SelectedItems.Count != 0);
		}
		private void pmSendMsg_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this._NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				return;
			}
			int index = -1;
			if (!int.TryParse(this.listViewNote.SelectedIndices[0].ToString(), out index))
			{
				MessageBox.Show("未选择日志！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			else
			{
				string text = this.listViewNote.Items[index].SubItems[2].Text;
				string text2 = this.listViewNote.Items[index].SubItems[10].Text;
				new FrmSendMsg
				{
					NoteRemoteObject = this._NoteRemoteObject,
					LoginInfo = this._LoginInfo,
					ReceiverName = text2,
					NoteDate = text
				}.ShowDialog();
			}
		}
		private void listViewNote_DoubleClick(object sender, EventArgs e)
		{
			if (this.listViewNote.SelectedItems.Count == 1)
			{
				try
				{
					if (!this._NoteRemoteObject.ConnectionTest())
					{
						MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						return;
					}
				}
				catch (Exception ex)
				{
					MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					return;
				}
				if (!(this.listViewNote.SelectedItems[0].Text.Trim() == ""))
				{
					FrmNoteInfo frmNoteInfo = new FrmNoteInfo();
					frmNoteInfo.NoteID = this.listViewNote.SelectedItems[0].Text;
					frmNoteInfo.LoginInfo = this._LoginInfo;
					frmNoteInfo.NoteRemoteObject = this._NoteRemoteObject;
					frmNoteInfo.Left = 100;
					frmNoteInfo.ShowDialog();
					frmNoteInfo.Dispose();
				}
			}
		}
		private void btnAddQuery_Click(object sender, EventArgs e)
		{
			if (this.sCurrentQueryBody == "")
			{
				MessageBox.Show("查询尚未建立！请先使用设计器设计查询，并成功执行一次，然后继续！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			else
			{
				try
				{
					if (!this._NoteRemoteObject.ConnectionTest())
					{
						MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						return;
					}
				}
				catch (Exception ex)
				{
					MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					return;
				}
				FrmGetUserInput frmGetUserInput = new FrmGetUserInput();
				frmGetUserInput.Text = "查询名称";
				frmGetUserInput.lbMsg.Text = "请输入要保存的查询名称";
				frmGetUserInput.tboxValue.Text = "";
				if (frmGetUserInput.ShowDialog() == DialogResult.OK)
				{
					string text = frmGetUserInput.tboxValue.Text.Trim();
					frmGetUserInput.Dispose();
					if (text == "")
					{
						MessageBox.Show("查询名称不能为空！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					}
					else
					{
						string[,] array = new string[0, 0];
						string text2 = "";
						this.sCurrentQueryBody = this.sCurrentQueryBody.Replace("'", "’");
						bool flag = this._NoteRemoteObject.CommonQuery(string.Concat(new string[]
						{
							"exec usp_wn_notequeryfavorite 1,0,'",
							this._LoginInfo.LoginID,
							"','",
							text,
							"','",
							this.sCurrentQueryBody,
							"'"
						}), ref array, ref text2);
						if (text2.Trim() != "")
						{
							MessageBox.Show("添加查询到收藏夹失败！" + text2, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						}
						else
						{
							if (array[0, 0] == "T")
							{
								this.sCurrentQueryBody = "";
								this.GetNoteQueryFavorite();
							}
							MessageBox.Show(array[0, 1], "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						}
					}
				}
				else
				{
					frmGetUserInput.Dispose();
				}
			}
		}
		private void GetNoteOwners()
		{
			try
			{
				if (!this._NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				return;
			}
			string[,] array = new string[0, 0];
			string text = "";
			bool flag = this._NoteRemoteObject.CommonQuery("select EmpID,EmpName from Employees(nolock) where PurID not in(0,4) and RecordState = 0", ref array, ref text);
			if (text.Trim() != "")
			{
				MessageBox.Show("获取人员列表失败！" + text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			else
			{
				int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
				this.cbbNoteOwnerIDs.Items.Clear();
				this.cbbNoteOwnerNames.Items.Clear();
				this.cbbNoteOwnerIDs.Items.Add("0");
				this.cbbNoteOwnerNames.Items.Add("全部人员");
				for (int i = 0; i < num; i++)
				{
					this.cbbNoteOwnerIDs.Items.Add(array[i, 0]);
					this.cbbNoteOwnerNames.Items.Add(array[i, 1]);
				}
				this.cbbNoteOwnerNames.SelectedIndex = 0;
			}
		}
		private void GetNoteQueryFavorite()
		{
			try
			{
				if (!this._NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				return;
			}
			string[,] array = new string[0, 0];
			string text = "";
			bool flag = this._NoteRemoteObject.CommonQuery("exec usp_wn_notequeryfavorite 0,0,'" + this._LoginInfo.LoginID + "','',''", ref array, ref text);
			if (text.Trim() != "")
			{
				MessageBox.Show("获取收藏夹中的查询失败！" + text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			else
			{
				int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
				this.cbbqueryname.Items.Clear();
				this.tmpListView.Items.Clear();
				this.treeViewNote.Nodes.Clear();
				TreeNode treeNode = new TreeNode();
				treeNode.Text = "我的查询";
				this.treeViewNote.Nodes.Add(treeNode);
				for (int i = 0; i < num; i++)
				{
					this.cbbqueryname.Items.Add(array[i, 2]);
					ListViewItem listViewItem = new ListViewItem();
					listViewItem.Text = array[i, 0];
					listViewItem.SubItems.Add(array[i, 1]);
					listViewItem.SubItems.Add(array[i, 2]);
					listViewItem.SubItems.Add(array[i, 3].Replace("’", "'"));
					TreeNode treeNode2 = new TreeNode();
					treeNode2.Text = array[i, 2];
					treeNode2.ImageIndex = 15;
					treeNode2.Tag = i;
					treeNode.Nodes.Add(treeNode2);
					this.tmpListView.Items.Add(listViewItem);
				}
				treeNode.ExpandAll();
			}
		}
		private void FrmNoteQuery_Shown(object sender, EventArgs e)
		{
			ColumnHeader columnHeader = new ColumnHeader();
			columnHeader.Text = "FavID";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.tmpListView.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "EmpID";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.tmpListView.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "QueryName";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.tmpListView.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "QueryBody";
			columnHeader.Width = 75;
			columnHeader.TextAlign = HorizontalAlignment.Center;
			this.tmpListView.Columns.Add(columnHeader);
			this.GetNoteQueryFavorite();
			this.GetNoteOwners();
			if (this._LoginInfo.PurviewID == "3" || this._LoginInfo.PurviewID == "4")
			{
				this.cbbNoteOwnerNames.Enabled = true;
			}
			else
			{
				this.cbbNoteOwnerNames.SelectedIndex = this.cbbNoteOwnerNames.Items.IndexOf(this._LoginInfo.LoginName);
				this.cbbNoteOwnerNames.Enabled = false;
			}
		}
		private void QueryNote(int aNoteQueryIndex)
		{
			if (aNoteQueryIndex != -1)
			{
				ListViewItem listViewItem = new ListViewItem();
				listViewItem = this.tmpListView.Items[aNoteQueryIndex];
				string text = listViewItem.SubItems[3].Text;
				string[,] array = new string[0, 0];
				string text2 = "";
				bool flag = this._NoteRemoteObject.CommonQuery(text, ref array, ref text2);
				if (flag)
				{
					this.Text = "日志查询 - " + this.cbbqueryname.Text;
					int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
					this.listViewNote.BeginUpdate();
					this.listViewNote.Items.Clear();
					for (int i = 0; i < num; i++)
					{
						listViewItem = new ListViewItem();
						listViewItem.Text = array[i, 0];
						listViewItem.SubItems.Add(array[i, 1]);
						listViewItem.SubItems.Add(array[i, 2]);
						listViewItem.SubItems.Add(array[i, 3]);
						listViewItem.SubItems.Add(array[i, 4]);
						listViewItem.SubItems.Add(array[i, 5]);
						if (array[i, 6] == "未审核")
						{
							listViewItem.SubItems.Add("未审核");
							listViewItem.ImageIndex = 1;
						}
						if (array[i, 6] == "已审核")
						{
							listViewItem.SubItems.Add("已审核");
							listViewItem.ForeColor = System.Drawing.Color.Blue;
							listViewItem.ImageIndex = 2;
						}
						if (array[i, 6] == "被置疑")
						{
							listViewItem.SubItems.Add("被置疑");
							listViewItem.ForeColor = System.Drawing.Color.Red;
							listViewItem.ImageIndex = 3;
						}
						listViewItem.SubItems.Add(array[i, 7]);
						listViewItem.SubItems.Add(array[i, 8]);
						listViewItem.SubItems.Add(array[i, 9]);
						listViewItem.SubItems.Add(array[i, 10]);
						listViewItem.SubItems.Add(array[i, 11]);
						listViewItem.SubItems.Add(array[i, 12]);
						listViewItem.SubItems.Add(array[i, 13]);
						listViewItem.SubItems.Add(array[i, 14]);
						listViewItem.SubItems.Add(array[i, 15]);
						listViewItem.SubItems.Add(array[i, 16]);
						this.listViewNote.Items.Add(listViewItem);
					}
					this.listViewNote.EndUpdate();
					this.listViewNote.Refresh();
				}
				else
				{
					MessageBox.Show(text2, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
			}
		}
		private void cbbqueryname_SelectedIndexChanged(object sender, EventArgs e)
		{
			this.QueryNote(this.cbbqueryname.SelectedIndex);
		}
		private void btndel_Click(object sender, EventArgs e)
		{
			if (this.cbbqueryname.SelectedIndex != -1)
			{
				if (MessageBox.Show("确定要删除查询<" + this.cbbqueryname.Text + ">吗？", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) != DialogResult.No)
				{
					ListViewItem listViewItem = new ListViewItem();
					listViewItem = this.tmpListView.Items[this.cbbqueryname.SelectedIndex];
					string aStrSql = string.Concat(new string[]
					{
						"exec usp_wn_notequeryfavorite 2,",
						listViewItem.Text,
						",'",
						this._LoginInfo.LoginID,
						"','',''"
					});
					string[,] array = new string[0, 0];
					string text = "";
					if (!this._NoteRemoteObject.CommonQuery(aStrSql, ref array, ref text))
					{
						MessageBox.Show(text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					}
					else
					{
						MessageBox.Show(array[0, 1], "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						if (array[0, 0] == "T")
						{
							this.GetNoteQueryFavorite();
						}
					}
				}
			}
		}
		private bool GetRemoteTaskType()
		{
			string text = "";
			bool result;
			if (this._LoginInfo.LoginSuccess)
			{
				this.GetLocalTaskType(this.cbbNoteTypeID, this.cbbNoteTypeName, this.GetEmpType(), true, ref text);
				if (this.cbbNoteTypeName.Items.Count >= 2)
				{
					result = true;
				}
				else
				{
					string[,] array = new string[0, 0];
					this.cbbNoteTypeName.Cursor = Cursors.WaitCursor;
					this.cbbNoteTypeID.Items.Clear();
					this.cbbNoteTypeName.Items.Clear();
					bool flag = this._NoteRemoteObject.CommonQuery("select a.TaskID,a.TaskDesc,isnull(b.EmpType,0) from TaskType a(nolock),Employees b(nolock) where a.EmpType = isnull(b.EmpType,0) and b.EmpID = '" + this._LoginInfo.LoginID + "'", ref array, ref text);
					if (flag)
					{
						int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
						int num2 = array.GetUpperBound(1) - array.GetLowerBound(1) + 1;
						this.ClearLocalTaskType();
						for (int i = 0; i <= num - 1; i++)
						{
							this.cbbNoteTypeID.Items.Add(array[i, 0]);
							this.cbbNoteTypeName.Items.Add(array[i, 1]);
							this.SaveTaskTypeToLocalMdb(array[i, 0], array[i, 1], array[i, 2], ref text);
						}
						this.cbbNoteTypeID.Items.Add("0");
						this.cbbNoteTypeName.Items.Add("未分类");
						this.cbbNoteTypeName.Cursor = Cursors.Hand;
					}
					this.cbbNoteTypeName.Cursor = Cursors.Hand;
					result = flag;
				}
			}
			else
			{
				this.GetLocalTaskType(this.cbbNoteTypeID, this.cbbNoteTypeName, "", false, ref text);
				result = true;
			}
			return result;
		}
		private string GetEmpType()
		{
			string text = "";
			string[,] array = new string[0, 0];
			string aStrSql = "select EmpType from Employees where EmpID = '" + this._LoginInfo.LoginID + "'";
			string result = "";
			if (this._NoteRemoteObject.CommonQuery(aStrSql, ref array, ref text))
			{
				result = array[0, 0];
			}
			return result;
		}
		private bool GetLocalTaskType(System.Windows.Forms.ComboBox objComboBoxTaskID, System.Windows.Forms.ComboBox objComboBoxTaskName, string aEmpType, bool bHasLogin, ref string aErrMsg)
		{
			string[,] array = new string[0, 0];
			objComboBoxTaskID.Items.Clear();
			objComboBoxTaskName.Items.Clear();
			this.cbbNoteTypeName.Cursor = Cursors.WaitCursor;
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				aErrMsg = "数据库连接失败！";
				GC.Collect();
				result = false;
			}
			else
			{
				string text;
				if (bHasLogin)
				{
					text = "select [TaskID],[TaskDesc] from [TaskType] where [EmpType]=" + aEmpType;
				}
				else
				{
					text = "select [TaskID],[TaskDesc] from [TaskType]";
				}
				array = localAccess.Open(text);
				if (localAccess.Message != "")
				{
					aErrMsg = "查询失败！" + localAccess.Message + "\nSQL语句=" + text;
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
					int num2 = array.GetUpperBound(1) - array.GetLowerBound(1) + 1;
					for (int i = 0; i < num; i++)
					{
						objComboBoxTaskID.Items.Add(array[i, 0]);
						objComboBoxTaskName.Items.Add(array[i, 1]);
					}
					objComboBoxTaskID.Items.Add("0");
					objComboBoxTaskName.Items.Add("未分类");
					localAccess.DisConnect();
					GC.Collect();
					this.cbbNoteTypeName.Cursor = Cursors.Hand;
					result = true;
				}
			}
			return result;
		}
		private bool SaveTaskTypeToLocalMdb(string aTaskID, string aTaskDesc, string aEmpType, ref string aErrMsg)
		{
			string[,] array = new string[0, 0];
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				aErrMsg = "保存失败！本地数据库连接失败！";
				GC.Collect();
				result = false;
			}
			else
			{
				if (aTaskID.Trim() == "")
				{
					aErrMsg = "保存失败！日志分类代码不能为空！";
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					if (aTaskDesc.Trim() == "")
					{
						aErrMsg = "保存失败！日志分类名称不能为空！";
						localAccess.DisConnect();
						GC.Collect();
						result = false;
					}
					else
					{
						string aStrSql = string.Concat(new string[]
						{
							"insert into [TaskType]([TaskID],[TaskDesc],[EmpType]) values('",
							aTaskID,
							"','",
							aTaskDesc,
							"',",
							aEmpType,
							")"
						});
						int num = localAccess.ExecSQL(aStrSql);
						if (num != 1)
						{
							aErrMsg = localAccess.Message;
							localAccess.DisConnect();
							GC.Collect();
							result = false;
						}
						else
						{
							localAccess.DisConnect();
							GC.Collect();
							result = true;
						}
					}
				}
			}
			return result;
		}
		private bool ClearLocalTaskType()
		{
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				GC.Collect();
				result = false;
			}
			else
			{
				string aStrSql = "delete from [TaskType]";
				int num = localAccess.ExecSQL(aStrSql);
				if (localAccess.Message != "")
				{
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					localAccess.DisConnect();
					GC.Collect();
					result = (num != 0);
				}
			}
			return result;
		}
		private void cbbNoteTypeName_DropDown(object sender, EventArgs e)
		{
			if (this.cbbNoteTypeName.Items.Count == 0)
			{
				this.GetRemoteTaskType();
			}
		}
		private void treeViewNote_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
		{
			if (e.Node.Level != 0)
			{
				int selectedIndex = Convert.ToInt32(e.Node.Tag.ToString());
				this.xtraTabControlQuery.SelectedTabPage = this.xtraTabPageResult;
				this.cbbqueryname.SelectedIndex = selectedIndex;
			}
		}
		private void cbkCreateDate_CheckedChanged(object sender, EventArgs e)
		{
			if (this.cbkCreateDate.Checked)
			{
				this.dtpCreateBeginDate.Enabled = false;
				this.dtpCreateEndDate.Enabled = false;
			}
			else
			{
				this.dtpCreateBeginDate.Enabled = true;
				this.dtpCreateEndDate.Enabled = true;
			}
		}
		private void cbkAuditDate_CheckedChanged(object sender, EventArgs e)
		{
			if (this.cbkAuditDate.Checked)
			{
				this.dtpAuditBeginDate.Enabled = false;
				this.dtpAuditEndDate.Enabled = false;
			}
			else
			{
				this.dtpAuditBeginDate.Enabled = true;
				this.dtpAuditEndDate.Enabled = true;
			}
		}
		private void xtraTabControlQuery_SelectedPageChanged(object sender, TabPageChangedEventArgs e)
		{
			if (this.xtraTabControlQuery.SelectedTabPageIndex == 0)
			{
				base.MaximizeBox = true;
				base.MinimizeBox = true;
				base.FormBorderStyle = FormBorderStyle.Sizable;
				base.WindowState = FormWindowState.Maximized;
			}
			if (this.xtraTabControlQuery.SelectedTabPageIndex == 1)
			{
				base.MaximizeBox = false;
				base.MinimizeBox = true;
				base.FormBorderStyle = FormBorderStyle.FixedSingle;
				base.WindowState = FormWindowState.Normal;
				base.Left = (Screen.PrimaryScreen.WorkingArea.Width - base.Width) / 2;
				base.Top = (Screen.PrimaryScreen.WorkingArea.Height - base.Height) / 2;
				this.Text = "日志查询 - 查询设计";
			}
		}
	}
}
